package com.hundunjiang.common.mybatisplus.config;

import com.hundunjiang.common.mybatisplus.config.properties.MybatisPlusProperties;

import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MybatisPlusConfig {

    @Bean
    public MapperScannerConfigurer mapperScannerConfigurer(MybatisPlusProperties mybatisPlusProperties) {
        MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
        mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactory");
        mapperScannerConfigurer.setBasePackage(mybatisPlusProperties.getMapperScanner().toString());
        mapperScannerConfigurer.setBasePackage("com.hundunjiang.modules.system.mapper,com.hundunjiang.modules.form.mapper");
        return mapperScannerConfigurer;
    }
}
